package Practice;

import java.util.Scanner;

public class Pocket {
    public static boolean isPrime(int x){
        if (x == 2) return true;
        int x1 = (int) Math.sqrt(x);
        for (int i = 2; i <= x1; i++) {
            if (x%i==0)
                return false;
        }
        return true;
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int l = sc.nextInt();
        int num = 0;
        int n = 0;
        for (int i=2;num+i<=l;i++){
            if (isPrime(i)){
                    System.out.println(i);
                    num += i;
                    n++;
            }
        }
        System.out.println(n);
    }
}
